﻿@model ICollection<Microsoft.AspNetCore.Identity.UserLoginInfo>
@using cloudscribe.Core.Web
@using Microsoft.Extensions.Options
@using Microsoft.Extensions.Localization
@inject IStringLocalizer<CloudscribeCore> sr
@{
    ViewData["Title"] = sr["Remove Login"];
    ViewData["BodyClass"] = "manage-section remove-login";
    var removeFormat = sr["Remove this {0} login from your account"];
}
@if (Model.Count > 0)
{
    <h4>@sr["Registered Logins"]</h4>
    <table class="table">
        <tbody>
            @foreach (var account in Model)
            {
                <tr>
                    <td>@account.LoginProvider</td>
                    <td>
                        @if (ViewBag.ShowRemoveButton)
                        {
                            <form asp-controller="Manage" asp-action="RemoveLogin" asp-route-returnurl='@ViewData["ReturnUrl"]' method="post" class="form-horizontal" role="form">
                                <div>
                                    <input asp-for="@account.LoginProvider" type="hidden" />
                                    <input asp-for="@account.ProviderKey" type="hidden" />
                                    <input type="submit" class="btn btn-default" value='@sr["Remove"]' title="@string.Format(removeFormat, account.LoginProvider)" />
                                </div>
                            </form>
                        }
                        else
                        {
                            @: &nbsp;
                        }
                    </td>
                </tr>
            }
        </tbody>
    </table>
}
